﻿using System.IO;
using UnityEngine;

namespace Nirvana
{
    /// <summary>
    /// 用于读取StreamingAssets目录下的资源
    /// </summary>
    public static class StreamingAssetsUtil
    {
        public static string ReadAllText(string filePath)
        {
            string path = Path.Combine(Application.streamingAssetsPath, filePath);
            if (File.Exists(path))
            {
                return File.ReadAllText(path);
            }
            return string.Empty;
        }

        public static bool Existed(string filePath)
        {
            string path = Path.Combine(Application.streamingAssetsPath, filePath);
            return File.Exists(path);
        }

    }
}

